$(() => {
    // 获取用户名与密码
    $('#login_form').on('submit', (e) => {
        console.log(111111111);
        // 阻止默认行为
        e.preventDefault()
        // serialize获取表单数据值
        const data = $('#login_form').serialize()
        console.log(data);
        $.ajax({
            type:'post',
            url:'http://localhost:8080/api/v1/admin/user/login',
            data,
            success:(res) => {
                console.log(res);
                // 登陆成功本地存储tpken
                localStorage.setItem('dsj_token',res.token)
                // 页面跳转
                location.href='index.html'
            }
        })
    })
})